import 'package:appflutter/Http_request/Http_request.dart';
import 'package:appflutter/Http_request/RequestApi.dart';
import 'package:appflutter/Pages/Home/home_model.dart';

class home_request {

  Future<List<movie_item>> get_home_movieItems(int start, int count) async {

    final result = await HttpRequest.request('${request_api().movieTop250}',
        method: 'get', params: {'start': '$start', 'count': '$count'});
    //json 转模型
    List<movie_item> movies = [];

    for(var sub in result['subjects']){

      movies.add(movie_item.from(sub));

    }

    return movies;

  }
}
